package com.example.userservice.controller;

import com.example.userservice.pojo.Org;
import com.example.userservice.service.OrgService;
import com.example.userservice.utils.ResultData;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/org")
@Slf4j
public class OrgController {

    @Autowired
    private OrgService orgService;

    @GetMapping("/getOrgTree")
    public ResultData getOrgTree(){
        List<Org> vo = orgService.getOrgTree();
        return ResultData.success(vo);
    }
}
